public class BinomioNewton{

   public static double fat(int N, int i) {

		double fatorialResult = 0.0;
		
		fatorialResult = fatorial(N) / (fatorial(i) * fatorial(N - i));				
		return fatorialResult;
	}
	
	public static double fatorial(int n) {
		
	    if (n == 1 || n == 0) {
			return 1;
		} 		
		else {
			return n * fatorial(n-1);
		}		
	}
}